int index_bf(SqString *s,SqString *t,int start){  
    if(0 == t->length || start < 1 || start > s->length)
        return (0);
    int pos=start-1;
    int i=pos; 
    int j=0;   
    while( i < s->length && j < t->length )
    {
        if(s->data[i] == t->data[j])
        {
            i++;
            j++;
        }
        else  
        {
            pos++; 
            i=pos; 
            j=0;    
        }
    }
    if(j >= t->length)
        return (pos-start+2); 
    else
        return (-1); 
}

int index_kmp(SqString *s,SqString *t,int start,int next[]){ 
    if(0 == t->length || start < 1 || start > s->length)
        return (0);
    int i=start-1;  
    int j=0;        
    while(i<s->length && j<t->length)
    {
        if(-1 == j || (s->data[i] == t->data[j]))
        {
            i++;
            j++;
        }
        else  
        {
            j=next[j];
        }
    }
    if(j>=t->length)
        return (i-j-start+2);
    else
        return (-1); 
}